Skip to main content

Loan Management APIs

These endpoints cover loan disbursement, payment recording, and live loan account status.

Authentication

All requests require:

Authorization: Bearer demo-credify-token

4. Loan Disbursement

Endpoint

POST /api/v1/loans/{loan_id}/disburse

Description

Register a loan disbursement and generate a transaction reference.

Sample request

{
"merchant_bank_account": "EG380019000500000000263180002",
"disbursement_amount": 32000.0,
"disbursement_date": "2026-04-24",
"disbursement_method": "bank_transfer"
}

Sample response

{
"loan_id": "LN-2026-001",
"merchant_bank_account": "EG380019000500000000263180002",
"disbursement_amount": 32000.0,
"disbursement_date": "2026-04-24",
"disbursement_method": "bank_transfer",
"disbursement_reference": "DISB-LN-2026-001-002",
"status": "completed"
}
FieldTypeDirectionDescription
loan_idstringRequestTarget loan account
merchant_bank_accountstringRequestReceiving account
disbursement_amountdecimalRequestAmount to send
disbursement_datedateRequestScheduled disbursement date
disbursement_methodenumRequestbank_transfer, wallet, check
disbursement_referencestringResponseGenerated transfer reference
statusenumResponsepending, completed, failed

5. Record Repayment

Endpoint

POST /api/v1/loans/{loan_id}/payments

Description

Record a repayment and automatically split the amount into principal and interest.

Sample request

{
"payment_amount": 5200.0,
"payment_date": "2026-05-30",
"payment_method": "auto_debit"
}

Sample response

{
"loan_id": "LN-2026-001",
"payment_amount": 5200.0,
"payment_date": "2026-05-30",
"payment_method": "auto_debit",
"principal_amount": 4823.3,
"interest_amount": 376.7,
"remaining_balance": 21382.03
}
FieldTypeDirectionDescription
loan_idstringRequestLoan account reference
payment_amountdecimalRequestAmount received
payment_datedateRequestPayment booking date
payment_methodenumRequestauto_debit, manual_transfer, revenue_share
principal_amountdecimalResponseApplied to principal
interest_amountdecimalResponseApplied to interest
remaining_balancedecimalResponseBalance after posting

6. Loan Account Status

Endpoint

GET /api/v1/loans/{loan_id}

Description

Return the live loan account summary with payment history and next due date.

Sample response

{
"loan_id": "LN-2026-001",
"merchant_id": "MCH-22346",
"original_amount": 32000.0,
"outstanding_balance": 26205.33,
"next_payment_due_date": "2026-05-18",
"payment_status": "current",
"total_payments_made": 2,
"currency": "EGP",
"business_name": "Nile Home Goods",
"interest_rate": 17.25,
"term_months": 10,
"disbursement_status": "completed"
}
FieldTypeDescription
loan_idstringUnique loan identifier
merchant_idstringAssociated merchant
original_amountdecimalInitial approved principal
outstanding_balancedecimalCurrent balance owed
next_payment_due_datedateNext scheduled due date
payment_statusenumcurrent, overdue, paid_off, defaulted
total_payments_madeintegerNumber of recorded payments
currencystringMerchant currency, fixed to EGP in this demo
business_namestringMerchant legal name
interest_ratedecimalAPR applied to the loan
term_monthsintegerLoan duration
disbursement_statusenumLate